<?php
namespace ITSociaal\Themes\HuisVanHerstel;
/**
 * Third party plugins that hijack the theme will call wp_footer() to get the footer template.
 * We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template.
 *
 * If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
 * WooCommerce) you can delete this file and header.php
 */

call_user_func(function() {
	$timberContext = $GLOBALS["timberContext"];

	if (!isset($timberContext)) {
		/* TODO: Throw our own Exception */
		throw new \Exception("Timber context not set in footer.");
	}

	$timberContext["content"] = ob_get_clean();
	$templates                = ["page-plugin.twig"];

	Timber::render($templates, $timberContext);
});

/* vi:set ts=4 sw=4 noet: */
